<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <table border="1">
        <thead>
        <tr>
            <td>类别</td>
            <td>标题</td>
            <td>作者</td>
            <td>创建时间</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        {% for obj in res %}
        <tr>
            <td>{{ obj.categoryId }}</td>>
            <td><a href="/news/detail/{{ obj.id }}">{{ obj.title }}</a></td>>
            <td>{{ obj.author }}</td>>
            <td>{{ obj.createDate }}</td>>
            <td><button onclick="delNew({{ obj.id }})">删除</button> </td>>
        </tr>>
        {% endfor %}
        </tbody>
    </table>
{% if err %}
    {{ err }}
{% endif %}
<script>
    function delNew(id){
        if(confirm('确认删除吗？')){
            location.href=`/news/delnew/${id}`
        }
    }
</script>    
</body>
</html>